<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web'],'prefix'=>'admin','namespace'=>'admin'], function () {
    Route::match(['get','post'],'/login', 'loginController@login');
    Route::any('code', 'loginController@code');
//     Route::get('test', 'loginController@test');
});

Route::group(['middleware' => ['web','admin.login'],'prefix'=>'admin','namespace'=>'admin'], function () {
    Route::get('/', 'IndexController@index');
//     Route::get('index', 'IndexController@index');
    Route::get('info', 'IndexController@info');
    Route::get('logout', 'IndexController@logout');
    Route::match(['get','post'],'pass', 'IndexController@pass');
    Route::resource('category', 'CategoryControllers');
    Route::post('category/changeOrder', 'CategoryControllers@changeorder');
});
